const path = require('path')
const CracoLessPlugin = require('craco-less')

module.exports = {
  plugins: [
    {
      plugin: CracoLessPlugin,
      options: {
        lessLoaderOptions: {
          lessOptions: {
            modifyVars: { '@primary-color': '#F00' },
            javascriptEnabled: true,
          },
        },
      },
    },
  ],
  webpack: {
    alias: { // 别名
      '@': path.join(__dirname, './src'),
      'api': path.join(__dirname, './src/api'),
    },
  },
  devServer: {
    port: 9527,
    proxy: {
      '/qq': {
        target: 'https://view.inews.qq.com',
        changeOrigin: true,
        pathRewrite: {
          '^/qq': '',
        },
      },
    },
  },
}
